#include <iostream>
#include <vector>
#include <climits>

using namespace std;

// 2081. k 镜像数字的和
// https://leetcode.cn/problems/sum-of-k-mirror-numbers/description/?envType=daily-question&envId=2025-06-23

class Solution
{
public:
    bool isPalindrome(long long x, int k)
    {
        if (x % k == 0)
        {
            return false;
        }
        int ret = 0;
        while (ret < x / k)
        {
            ret *= k;
            ret += x % k;
            x /= k;
        }
        return x == ret || ret == x / 10;
    }
    long long kMirror(int k, int n)
    {
        long long ans = 0;
        for (int i = 1; i <= INT_MAX; i++){
            if(isPalindrome(i,10) && isPalindrome(i, k)){
                ans += i;
                n--;
                if(n == 0){
                    break;
                }
            }
        }
        return ans;
    }
};

int main()
{
    return 0;
}